package com.itbaizhan.paymentdemo.controller;

import com.itbaizhan.paymentdemo.config.WxPayConfig;
import com.itbaizhan.paymentdemo.config.ZfbPayConfig;
import com.itbaizhan.paymentdemo.vo.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class testController {

    @Autowired
    private WxPayConfig wxPayConfig;

    @Autowired
    private ZfbPayConfig zfbPayConfig;
    @GetMapping("test")
    public BaseResult test(){
        return BaseResult.ok("购物愉快");
    }

    /**
     * 测试读取wxpay.properties
     * @return
     */
    @GetMapping("getconfig")
    public BaseResult getConfig(){
        return BaseResult.ok(wxPayConfig.getMchId());
    }

    @GetMapping("getzfbConfig")
    public BaseResult getZfb(){
        return BaseResult.ok(zfbPayConfig.getGateway());
    }
}
